/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package book.test;

import homework.demo3.BookBean;
import java.util.Hashtable;

/**
 *
 * @author Administrator
 */
public class BookDemo {
    public static void main(String[] args) {
        
        Hashtable s = new Hashtable();
        BookBean tmp = null;
        s.put("isbn001", new BookBean("isbn001","红楼梦","曹雪芹","水电出版社",100));
        s.put("isbn002", new BookBean("isbn002","西游记","吴承恩","水电出版社",100));
        s.put("isbn003", new BookBean("isbn003","水浒传","施耐庵","水电出版社",100));
        s.put("isbn004", new BookBean("isbn004","三国演义","罗贯中","水电出版社",100));
        s.put("isbn005", new BookBean("isbn005","喻世明言","冯梦龙","水电出版社",100));
        
        
        String key="isbn002";
        if(s.containsKey(key)){
            tmp=(BookBean)(s.get(key));
            System.out.println("书名："+tmp.getName());
            System.out.println("作者："+tmp.getAuthor());
            System.out.println("出版社："+tmp.getPublisher());
            System.out.println("价格："+tmp.getPrice());
            System.out.println("**："+tmp.getIsbn());
            
        }
        else{
            System.out.println("查无此书");
        }
        
    
    }

}
